<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //创建一个ajax对象
        var xhr=new XMLHttpRequest();
        //请求
        //打开请求
        xhr.open()
        xhr.send()
        //响应
        xhr.onload=function(){
            console.log(xhr.responseText)
            var jsonData=JSON.parse(xhr.responseText);
            console.log(jsonData);
            
        }
    </script>
</body>
</html>